/**
 * This file is part of RailEGo
 * Copyright (c) 2023 Guo Tingjin <dev@peercat.cn>
 * RailEGo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * RailEGo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

export interface BaseParams {
  cookies: string;
}

/**
 * 请求余票参数
 * @param month 请求月份
 * @param day 请求日期
 * @param from 起始车站
 * @param to 到达车站
 * @param passengerType 乘客类型
 */
export interface ScheduleRequestParams extends BaseParams {
  month: number;
  day: number;
  from: string;
  to: string;
  passengerType: string;
}

export interface BypassStationRequestParams extends BaseParams {
  month: number;
  day: number;
  trainNumber: string;
  fromStationCode: string;
  toStationCode: string;
}

export interface TicketPriceRequestParams extends BaseParams {
  trainNumber: string;
  fromNumber: string;
  toNumber: string;
  seatTypes: string;
  month: number;
  day: number;
}

export interface LoginGetVerifyCheckParams extends BaseParams {
  appId?: string; //=otn
  username: string;
}

export interface LoginUamTkRequestParams extends BaseParams {
  appId?: string; //=otn
  username: string;
  password: string;
  checkMode?: number; //=0
  scene?: string;
  sessionId?: string;
  randCode: string; //短信验证码
  sig?: string;
  if_check_slide_passcode_token?: string;
}

export interface LoginNewAppTokenRequestParams extends BaseParams {
  appId?: string;
}

export interface LoginTokenRequestParams extends BaseParams {
  token: string;
}

export interface SmsVerifyCodeRequestParams extends BaseParams {
  appId?: string; //=otn
  username: string; //用户名
  castNum: string; //身份证后四位
}

export interface QueryOrderRequestParams extends BaseParams {
  comeFromFlag?: string; //=my_order
  pageIndex?: number; //0
  pageSize?: number; //8
  queryWhere: 'H' | 'G'; //G 未出行  H 历史订单
  queryStartDate?: string;
  queryEndDate?: string;
  queryType?: number; //=1
  sequeue_train_name?: string; //订单号/车次/姓名   没有打错，和12306保持一致
}

export interface QueryOrderIncompleteRequestParams extends BaseParams {
  jsonAtt?: string;
}

export interface QueryPossibleTrainRequestParams extends BaseParams {
  date: string;
  keyword: string;
}

export interface QueryTrainInfoRequestParams extends BaseParams {
  trainNo: string;
  trainDate: string;
  randCode?: string;
}

export interface QueryAgentSellParams extends BaseParams {
  province: string;
  city?: string;
  county?: string;
}

export interface QueryTicketCheckParams {
  trainDate: string; //2023-09-09
  stationTrainCode: string; //G4
  fromStationTelecode: string; //OHH
}